#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
    char arr[100] = { 0 };
    int i = 0;
    for (i = 0; i < 100; i++) {
        scanf("%c", &arr[i]);
    }
    int conutA = 0;
    int countB = 0;
    for (i = 0; i < 100; i++)
    {
        if (arr[i] == 'A')
        {
            conutA++;
        }
        else if (arr[i] == 'B') {
            countB++;
        }

    }
    if (countB > conutA)
    {
        printf("B");
    }
    if (countB < conutA)
    {
        printf("A");
    }
    if (countB == conutA)
        printf("E");

    return 0;
}